//
//  PayViewController.m
//  LoverGo
//
//  Created by liudonghuan on 14-9-12.
//  Copyright (c) 2014年 yexiao. All rights reserved.
//

#import "PayViewController.h"
#import "LGUtil.h"
@interface PayViewController ()

@end

@implementation PayViewController


-(id)initWithOrderUuid:(NSString *)orderuuid
{
    self = [super init];
    if (self) {
        _orderUuid = orderuuid;
        self.hidesBottomBarWhenPushed = YES;
    }
    return self;
}
-(void)loadView
{
    [self dinglan];
    _paywebview = [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
    NSString *_myurl = [NSString stringWithFormat:@"%@%@",@"?activityOrderUuid=",_orderUuid];
    NSString *urlurl =[[NSString alloc]initWithFormat:@"%@%@%@",@"http://server.lover-go.com/",@"activityOrder/payActivityOrder", _myurl];
    NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:urlurl]];
    [self setView:_paywebview];
    [_paywebview loadRequest:request];
}
-(void)dinglan{
    UIButton * backBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0,20, 20)];
    [backBtn setBackgroundImage:[UIImage imageNamed:@"btn_back.png"] forState:UIControlStateNormal];
    [backBtn addTarget:self action:@selector(dinglanBackBtn) forControlEvents:UIControlEventTouchUpInside] ;
    [backBtn setShowsTouchWhenHighlighted:YES] ;
    UIBarButtonItem *backbutton = [[UIBarButtonItem alloc]initWithCustomView:backBtn];
    self.navigationItem.leftBarButtonItem = backbutton;
    UILabel *title = [[UILabel alloc]initWithFrame:CGRectMake(90, 0, 140, 30)];
    title.textAlignment = UITextAlignmentCenter;
    title.textColor = LGCOLOR_blue;
    title.text = @"支付宝页面";
    self.navigationItem.titleView = title;
    
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"barBG.png"] forBarMetrics:UIBarMetricsDefault];
}
-(void)dinglanBackBtn{
    [self.navigationController popToRootViewControllerAnimated:YES];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [MobClick beginLogPageView:@"支付页面"];
}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    [MobClick endLogPageView:@"支付页面"];
}


@end
